using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Pow
{
    public class IntroState : DrawableGameComponent
    {

        Game1 game;
        Texture2D texture;
        int mov = 2;
        Vector2 logoPosition;

        public IntroState(Game game)
            : base(game)
        {
            this.game = game as Game1;
        }

        public override void Initialize()
        {
            base.Initialize();
            texture = game.Content.Load<Texture2D>("Logo");
            logoPosition = new Vector2((game.graphics.PreferredBackBufferWidth / 2) - (texture.Width / 2), game.graphics.PreferredBackBufferHeight);
        }

        public override void Update(GameTime gameTime)
        {
            logoPosition.Y -= mov;
            if (logoPosition.Y <= texture.Height / 2)
            {
                mov = 0;
                game.currentState = Game1.GameState.Menu;

            }
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            game.spriteBatch.Begin();
            game.spriteBatch.Draw(texture, logoPosition, Color.White);
            game.spriteBatch.End();
        }

    }
}
